﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
using CodeFirstStoredProcs;

namespace VietTrips.Domain.Models
{
    /// <summary>
    /// object for the procedure
    /// </summary>
    public class Search
    {
        public Search()
        {
            this.PriceFrom = 0;
            this.PriceTo = 100000000;
        }

        // override the parameter name. The parameter name is "DepartPlaceID"
        [StoredProcAttributes.Name("DepartPlaceID")]
        [StoredProcAttributes.ParameterType(SqlDbType.Int)]
        public int? DepartPlaceId { get; set; }

        // override the parameter name. The parameter name is "Duration"
        [StoredProcAttributes.Name("Duration")]
        [StoredProcAttributes.ParameterType(SqlDbType.Int)]
        public int? Duration { get; set; }

        // override the parameter name. The parameter name is "DepartTime"
        [StoredProcAttributes.Name("DepartTime")]
        [StoredProcAttributes.ParameterType(SqlDbType.DateTime)]
        public DateTime DeparTime { get; set; }

        // override the parameter name. The parameter name is "AreaID"
        [StoredProcAttributes.Name("AreaID")]
        [StoredProcAttributes.ParameterType(SqlDbType.Int)]
        public int? AreaId { get; set; }

        // override the parameter name. The parameter name is "PriceFrom"
        [StoredProcAttributes.Name("PriceFrom")]
        [StoredProcAttributes.ParameterType(SqlDbType.Float)]
        public double? PriceFrom { get; set; }

        // override the parameter name. The parameter name is "PriceTo"
        [StoredProcAttributes.Name("PriceTo")]
        [StoredProcAttributes.ParameterType(SqlDbType.Float)]
        public double? PriceTo { get; set; }
    }

    public class ResultSearch
    {
        [StoredProcAttributes.Name("TourName")]
        public string  TourName { get; set; }

        [StoredProcAttributes.Name("DepartTime")]
        public DateTime DepartmenTime { get; set; }

        [StoredProcAttributes.Name("DepartmentPlace")]
        public string DepartmentPlace { get; set; }

        [StoredProcAttributes.Name("PriceAdult")]
        public double PriceAdult { get; set; }

        [StoredProcAttributes.Name("Duration")]
        public int Duration { get; set; }

        [StoredProcAttributes.Name("SmallDecription")]
        public string SmallDecription { get; set; }

        [StoredProcAttributes.Name("FullDecription")]
        public string FullDecription { get; set; }

        [StoredProcAttributes.Name("ImageUrl")]
        public string ImageUrl { get; set; }

        [StoredProcAttributes.Name("StarOfTour")]
        public double StarOfTour { get; set; }

        [StoredProcAttributes.Name("CountReview")]
        public double CountReview { get; set; }

        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [StoredProcAttributes.Name("TripId")]
        public int TripId { get; set; }

        [StoredProcAttributes.Name("AreaName")]
        public string AreaName { get; set; }

    }
}
